<?php
/**
 * Project: Recipe
 * File: FoodSectionModel.class.php
 * Author: Xnfy520@gmail.com
 * Date: 12-4-17
 * Time: 下午3:56
 */

	class FoodSectionModel extends RelationModel{

		protected $_validate = array(
			array('name', 'require', '食材栏目名称不能为空', 1, 'regex', 3),
			array('sort', 'number', '排序必须为数字', 1, 'regex', 3),
		);

		protected $_link = array(
			'FoodCategory'=>array(
				'mapping_type'=>HAS_MANY,
				'mapping_name'=>'foodcategory',
				'class_name'=>'FoodCategory',
				'foreign_key'=>'foodsectionid',
			),

			'FoodArticle'=>array(
				'mapping_type'=>HAS_MANY,
				'mapping_name'=>'foodarticle',
				'class_name'=>'FoodArticle',
				'foreign_key'=>'sectionid',
			),
		);


	}